<template>
	<!-- shellmanagement米币管理 -->
	<view class="s_wp">
		<view class="s_item" v-for="(item,index) in list" :key="index">
			<image :src="item.logo" mode=""></image>
			<view class="s_info">
				<view class="s_title clamp2">{{item.supname}}</view>
				<view class="s_num">米币数：<text>{{item.credit1}}</text></view>
			</view>
		</view>
		<view class="fbt s_button" @click="$navTo('/pages/groupmenu/allocationshell')">米币调拨</view>
		<view class="loading_message">
			<image v-if="isloading" src="../../static/business/loading.gif"></image>
			<view v-if="isempty">到底了~</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				page: 0,

				isloading: false,
				isempty: false,
			}
		},
		onReachBottom() {
			this.getList();
		},
		onLoad() {
			this.getList();
		},
		methods: {
			getList() {
				this.page++;
				this.isloading = true;
				this.$axios('groupCredit/main', 'POST', 'supplier', {
					page: this.page
				}).then(res => {
					this.isloading = false;
					if (res.data.code == 200) {
						let length = res.data.data.length;
						this.list = this.list.concat(res.data.data);
						this.isempty = length <= 0 ? true : false;
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #f2f2f2;
		color: $font-color-base;
		padding-bottom: 130upx;
	}

	.s_wp {
		overflow: hidden;
	}

	.s_item {
		background: #fff;
		display: flex;
		align-items: center;
		margin-top: 20upx;
		padding: 20upx;
	}

	.s_item image {
		border-radius: 10upx;
		height: 90upx;
		width: 90upx;
	}

	.s_info {
		flex: 1;
		padding: 0 20upx;
	}

	.s_num {
		color: #000;
	}

	.s_num text {
		color: $font-color-spec;
		font-weight: bold;
	}

	.s_button {
		margin: 0;
		position: fixed;
		left: 3%;
		bottom: 30upx;
	}

	.loading_message {
		padding: 40upx;
		color: #0062CC;
		text-align: center;
	}

	.loading_message image {
		height: 50upx;
		width: 50upx;
	}
</style>
